package cn.hp.service.impl;
import cn.hp.entity.Dite;
import cn.hp.mapper.DiteMapper;
import cn.hp.service.DiteService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DiteServiceImpl implements DiteService {
    @Resource
    private DiteMapper diteMapper;
    @Override
    public List<Dite> selectDite(Dite dite) {
        return diteMapper.selectDite(dite);
    }
    @Override
    public PageInfo<Dite> selectDite(Dite dite, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Dite> list = diteMapper.selectDite(dite);
        return new PageInfo<>(list);
    }
    @Override
    public int insertDite(Dite dite) {
        return diteMapper.insertDite(dite);
    }
    @Override
    public int updateDite(Dite dite) {
        return diteMapper.updateDite(dite);
    }
    @Override
    public int deleteDiteById(Integer id) {
        return diteMapper.deleteDiteById(id);
    }
}